# coding: utf-8

import sys

username = 'Erick'
password = '123456'

def check(arg1, arg2):
    if arg1 != username:
        print('ID not exist!')
    else:
        if arg2 != password:
            print('Password Incorrect')
        else:
            print('Welcome Back!')
            sys.exit()


def login():
    user = input('ID > ')
    passwd = input('Password > ')
    check(user, passwd)

def main():
    time = 3
    while time > 0:
        login()
        time -= 1

if __name__ == '__main__':
    main()


# 可以用for循环改写while循环，代码会更简洁
